# 用户名、密码、黑名单
users = {
    '小红': {'name': '小红', 'password': '123', 'status': True},
    'mia': {'name': 'mia', 'password': '456', 'status': True},
    '小黑': {'name': '小黑', 'password': '784', 'status': False},
}
for i in range(3):
    user = input("请输入你的用户名：")
    pwd = input("请输入您的密码：")
    if user in users and users[user]['password'] == pwd and users[user]['status']:
        print("登陆成功！")
        break
    elif user in users and users[user]['password'] != pwd:
        print("密码不正确，请重新输入！")
    elif user in users and not users[user]['status']:
        print("用户无效，请重新注册！")
    else:
        print("用户不存在，请先注册账号！")
        new_user = input("请输入一个昵称：")
        pwd = input("请设置你的密码：")
        users[new_user] = {'name': new_user, 'password': pwd, 'status': True}

